////////////////////////////////////////////////////////////////////////////
/*! \file
 * \brief The implementation file for the MythMemory library.
 * \author Ivo Wingelaar
 * \date 2011
 * \version 0.1.0
 * \copyright GNU Lesser General Public License v3
 */
////////////////////////////////////////////////////////////////////////////

#include "MythMemory.hpp"
#include "MythMemory_InputMemory_C.hpp"
#include "MythMemory_OutputMemory_C.hpp"

namespace Myth
{
namespace Memory
{

////////////////////////////////////////////////////////////////////////////
//! Creates an input from a memory location.
_MYTH_MEMORY_API_ Stream::Input* _MYTH_CALL_CONV_ create_input_memory(const std::string& stream_name, void* memory, uintptr_t size, bool own_memory)
{
    return new InputMemory_C(stream_name, memory, size, own_memory);
}

////////////////////////////////////////////////////////////////////////////
//! Creates an output to a memory location.
_MYTH_MEMORY_API_ Stream::Output* _MYTH_CALL_CONV_ create_output_memory(const std::string& stream_name, void* memory, uintptr_t size, bool own_memory)
{
    return new OutputMemory_C(stream_name, memory, size, own_memory);
}

////////////////////////////////////////////////////////////////////////////
//! Returns the version of the MythMemory library.
_MYTH_MEMORY_API_ uint32_t _MYTH_CALL_CONV_ get_myth_memory_version(void)
{
    return MYTH_SDK_VERSION;
}

} // namespace Memory
} // namespace Myth
